import { getFactorySelectPage } from '@/api/merchant'
import { ref } from 'vue'

// 加载
const getFactorySelectPageLoading = ref(false)

// 下拉数据
const factoryOptional = ref<Array<{ id: string; name: string; select: boolean }>>([])

// 获取品牌商家下拉数据方法
const getFactorySelectPageFn = async (data: { limit: number; name: string; page: number }) => {
  getFactorySelectPageLoading.value = true
  const res = await getFactorySelectPage(data)
  factoryOptional.value = res.data.data.rows
  getFactorySelectPageLoading.value = false
}

export default {
  factoryOptional,
  getFactorySelectPageLoading,
  getFactorySelectPageFn,
}
